<!DOCTYPE html>
<html lang="zh">
	<head>
		<meta charset="utf-8">
		<title>webview</title>
		<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
		<script>
			$(document).ready(function() {
				onLoad()
			});

			function onLoad() {
				let num1 = GetUrlParam("num1")
				let num2 = GetUrlParam("num2")
				let num3 = GetUrlParam("num3")
				let num4 = GetUrlParam("num4")
				if (num1)
					$("#num1").text(num1)
				if (num2)
					$("#num2").text(num2)
				if (num3)
					$("#num3").text(num3)
				if (num4)
					$("#num4").text(num4)
			}

			function onClickFW(json) { //点击事件
				Android.onClickFW(json);
			}
			//获取url参数
			function GetUrlParam(paramName) {
				let url = decodeURI(window.location.href);
				console.log(url)
				var arrObj = url.split("?");
				if (arrObj.length > 1) {
					var arrPara = arrObj[1].split("&");
					var arr;
					for (var i = 0; i < arrPara.length; i++) {
						arr = arrPara[i].split("=");
						if (arr != null && arr[0] == paramName) {
							return arr[1];
						}
					}
					return "";
				} else {
					return "";
				}
			}
		</script>

		<style>
			body,
			html {
				height: 128px;
				width: 128px;
				margin: 0;
				padding: 0;
				overflow: hidden;
			}

			.container {
				display: flex;
				flex-direction: column;
				border-radius: 12px;
				width: 128px;
				height: 128px;
				background: rgba(102, 101, 132, 1);
				//box-shadow: 0px 0px 32px 0px rgba(0, 0, 0, 0.2);
				border-radius: 12px 12px 12px 12px;
				opacity: 1;
			}

			.row {
				display: flex;
				flex-direction: row;
				margin: 6px 6px 0px 6px;
			}

			.item {
				display: flex;
				flex-direction: column;
				justify-content: center;
				align-items: center;
				width: 55px;
				height: 55px;
				background: rgba(255, 255, 255, 0.1);
				border-radius: 8px 8px 8px 8px;
				opacity: 1;
			}

			.name {
				text-align: center;
				width: 34px;
				height: 17px;
				font-size: 13px;
				font-weight: 500;
				color: rgba(255, 255, 255, 0.6);
			}

			.num {
				text-align: center;
				margin-top: 6px;
				width: 21px;
				height: 18px;
				font-size: 14px;
				font-weight: bold;
				color: #FFFFFF;
			}
		</style>
	</head>

	<body style=" overflow:hidden" scroll="no">
		<div class="container">
			<div class="row">
				<div class="item" onclick="onClickFW('item1')">
					<div class="name">
						采购
					</div>
					<div id="num1" class="num">
						50
					</div>
				</div>
				<div class="item" onclick="onClickFW('item2')" style="margin-left: 6px;">
					<div class="name">
						售出
					</div>
					<div id="num2" class="num">
						20
					</div>
				</div>
			</div>
			<div class="row">
				<div class="item" onclick="onClickFW('item3')">
					<div class="name">
						折损
					</div>
					<div id="num3" class="num">
						3
					</div>
				</div>
				<div class="item" onclick="onClickFW('item4')" style="margin-left: 6px;">
					<div class="name">
						过期
					</div>
					<div id="num4" class="num">
						0
					</div>
				</div>
			</div>
		</div>
	</body>
</html>